import { axios } from '@/utils/request'

export function selectAllRole (type) {
  return axios({
    url: '/sys/sysRole/' + type + '/selectAllRole',
    method: 'get'
  })
}

export function selectPage (parameter) {
  return axios({
    url: '/sys/sysRole/selectPage',
    method: 'post',
    params: parameter
  })
}

export function selectRolesByUserId (userId) {
  return axios({
    url: '/sys/sysRole/' + userId + '/selectRolesByUserId',
    method: 'get'
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/sys/sysRole/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function del (id) {
  return axios({
    url: '/sys/sysRole/' + id + '/delete',
    method: 'get'
  })
}